import java.util.Arrays;
import java.util.Locale;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hp
 * Date: 2024-07-16
 * Time: 19:54
 */
public class Test {
    public static void main1(String[] args) {
        /*Scanner scanner = new Scanner(System.in);
        String str1 = scanner.next();
        String str2 = scanner.next();
        String str3 = scanner.next();
        System.out.println(str1);
        System.out.println(str2);
        System.out.println(str3);*/
    }
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int x = in.nextInt();
            int[] a = new int[n+1];
            for (int i = 1; i <= n; i++) {
                a[i] = in.nextInt();
            }
            int l = 0;
            int r = n;
            int sum = 0;
            for (int i = 1; i <= n; i++) {
                int l1 = i;
                int tmp = 0;
                tmp += a[i];
                int j = i + 1;
                for(; j <= n; j++) {
                    tmp += a[j];
                    if(tmp >= x) {
                        break;
                    }
                }
                int r1 = j;
                if (sum == 0 || (tmp >= x && sum > tmp) ) {
                    sum = tmp;
                    if(l1 > l && l < r && r1 == r) {
                        l = l1;
                    }
                    if(r1 < r && l < r) {
                        r = r1;
                    }
                }
            }
            System.out.print(l);
            System.out.print(" "+r);
        }
    }

    public static void main3(String[] args) {
        //Arrays.sort();
        StringBuffer stringBuffer = new StringBuffer();
        String str = "abc";
        char c = str.charAt(0);
        c = (char)(c - 32);
        System.out.println(c);
        stringBuffer.append('c');
        stringBuffer.append(c);
        System.out.println(stringBuffer);
    }


    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            String str = in.nextLine();
            StringBuffer sbf = new StringBuffer();
            char c = str.charAt(0);;
            if(str.charAt(0) >= 'a' && str.charAt(0) <= 'z') {
                c = (char)(c - 32);
            }
            sbf.append(c);
            for(int i = 1; i < str.length(); i++) {
                c = str.charAt(i);
                if(str.charAt(i) == ' ') {
                    if(str.charAt(i+1) >= 'a' && str.charAt(i+1) <= 'z') {
                        c = (char)(c - 32);
                    }
                    sbf.append(c);
                    i++;
                }
            }
            System.out.println(sbf);
        }
    }

}
